package com.eupmt.lab3.controllers.impl;

import com.eupmt.lab3.controllers.IUsuariController;
import com.eupmt.lab3.domain.Usuari;
import com.eupmt.lab3.persistence.ibatis.dao.UsuariDaoManager;
import com.eupmt.lab3.utils.Log;

/**
 *
 * @author sony
 */
public class UsuariController implements IUsuariController {

   //Atributes
   protected static UsuariController instance = null;
   private UsuariDaoManager dao = null;
   private Log log = null;

   //Constructors
   private UsuariController() {
      log = new Log();
   }


   public void saveUsuari(Usuari usuari) throws Exception {
      throw new UnsupportedOperationException("Not supported yet.");
   }

   public void insertUsuari(Usuari usuari) throws Exception {
      throw new UnsupportedOperationException("Not supported yet.");
   }

   public void updateUsuari(Usuari usuari) throws Exception {
      throw new UnsupportedOperationException("Not supported yet.");
   }

   public void deleteUsuari(Usuari usuari) throws Exception {
      throw new UnsupportedOperationException("Not supported yet.");
   }

   public Usuari getUsuariGranted(Usuari usuari) throws Exception {
      dao = UsuariDaoManager.getInstance();
      return dao.getUsuariGranted(usuari);
   }

   public Usuari getUsuariByLogin(String login) throws Exception {
      throw new UnsupportedOperationException("Not supported yet.");
   }




   // Patro Singleton
   public static UsuariController getInstance() {
      if (instance == null) {
         instance = new UsuariController();
      }

      return instance;
   }
}
